-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backports for 1.8-rc1/beta4 #44789
Backports for 1.8-rc1/beta4 #44789
Conversation
(cherry picked from commit d7782de)
Discovered while running the syntax tests with lines 25-28 of `jlfrontend.scm` commented out. Turned out we didn't handle `.op` correctly in neither `check-dotop` nor in `deparse`. This meant we just got `error: malformed expression` instead of an actually useful error message. (cherry picked from commit 9112135)
#44786) The current naming of `overlayed` is a bit confusing since `overlayed === true`, which is the conservative default value, actually means "it _may_ be overlayed" while `overlayed === false` means "this is absolutely not overlayed". I think it should be named as `nonoverlayed`, and then a query name like `is_nonoverlayed` would be more sensible than the alternative `is_overlayed`, which actually should be something like `can_be_overlayed`.
This commit adds new reflection utility named `Base.infer_effects` that works in the same way as `Base.return_types` but returns inferred effects instead. It would be helpful to test that certain method call has an expected effects. For example, we can now remove `Base.@pure` annotation from the definition of `BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N}` and checks it's still eligible for concrete evaluation like this (see <#44776 (comment)> for the context): ```julia julia> import Base.Broadcast: AbstractArrayStyle, DefaultArrayStyle, Unknown julia> function BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N} if Base.typename(A) === Base.typename(B) return A(Val(max(M, N))) end return Unknown() end BroadcastStyle (generic function with 1 method) julia> # test that the above definition is eligible for concrete evaluation @test Base.infer_effects(BroadcastStyle, (DefaultArrayStyle{1},DefaultArrayStyle{2},)) |> Core.Compiler.is_total_or_error Test Passed ``` Co-authored-by: Takafumi Arakaki <[email protected]>
…44808) Although they are basically equivalent in the current implementation, it would be more correct conceptually if we propagate `TRISTATE_UNKNOWN` instead of `ALWAYS_TRUE`, as it is hard or impossible to derive a global conclusion from a local analysis on each statement in most places. This commit also adds a docstring that simply explains the design of the effect analysis.
) This setting is particularly useful since it allows the compiler to evaluate a call of the applied method when all the call arguments are fully known, no matter if the call results in an error or not. This commit also adds some more explanations on the difference between `@pure` and `@assume_effects`.
Just found this case from code review, but this `Vararg` should be widened.
Now our abstract interpretation system caches two separate lattice properties return type and call effects, and the previous optimization to avoid adding backedge for a frame whose return type is `Any` turns out to be insufficient -- now we also need to make sure that the inferred effects don't provide any useful IPO information. Example: ```julia julia> const CONST_DICT = let d = Dict() for c in 'A':'z' push!(d, c => Int(c)) end d end; julia> Base.@assume_effects :total_may_throw getcharid(c) = CONST_DICT[c]; julia> @noinline callf(f, args...) = f(args...); julia> function entry_to_be_invalidated(c) return callf(getcharid, c) end; julia> @test Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) end |> Core.Compiler.is_concrete_eval_eligible Test Passed julia> @test fully_eliminated(; retval=97) do entry_to_be_invalidated('a') end Test Passed julia> getcharid(c) = CONST_DICT[c]; # now this is not eligible for concrete evaluation julia> @test Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) end |> !Core.Compiler.is_concrete_eval_eligible Test Failed at REPL[10]:1 Expression: Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) end |> !(Core.Compiler.is_concrete_eval_eligible) ERROR: There was an error during testing julia> @test !fully_eliminated() do entry_to_be_invalidated('a') end Test Failed at REPL[11]:1 Expression: !(fully_eliminated() do entry_to_be_invalidated('a') end) ERROR: There was an error during testing ```
This reduces invalidations when loading packages that define new AbstractString types. (cherry picked from commit 515a242)
(cherry picked from commit 03af781)
Acquiring this lock in many implementations could result in deadlock, even with an existing reader. Add a TLS check for reentry before, instead of relying on the implementation specifics, to avoid any issues. (cherry picked from commit 7df454b)
Put back a few lines that were removed by PR $42703 because they are required to successfully embed Julia with MSVC. (cherry picked from commit 209aad1)
Note: this is the first build of the real upstream version 1.2.12 which was released a few days ago. (cherry picked from commit 81e7cfc)
They look like this: ``` CC src/processor.o In file included from /Users/mhorn/Projekte/Julia/julia.master/src/processor.cpp:10: In file included from ./processor.h:5: ./julia.h:395:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types] struct { ^ ./julia.h:405:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types] struct { ^ 2 warnings generated. ``` and come from code that was introduced by @Keno in PR #43852. But it turns out that the union is not used at all! So I'm simply removing the offending union. Perhaps it is needed for some future work, but it should be trivial to add it back if needed. If that happens, I suggest a comment is added that explain why this looks similar to but has different layout compared to the `typedef _jl_purity_overrides_t` also in `julia.h`. (cherry picked from commit bb91e62)
(cherry picked from commit 4c858f8)
(cherry picked from commit b5bbb9f)
The event might have triggered on another thread before we observed it here, or it might have gotten finalized before it got triggered. Either outcome can result in a lost event. (I observed the later situation occurring locally during the Dates test once). (cherry picked from commit 8cc00ff)
(cherry picked from commit c589e0d)
If we load libjulia-codegen directly, e.g. from opt or llc, we don't call julia_init but init_llvm. Co-authored-by: Keno Fischer <[email protected]> (cherry picked from commit f562ad0)
By default Clang on Linux defines the macro `__GNUC__`, so to guard GCC-specific code paths it isn't sufficient to check `#ifdef __GNUC__`. (cherry picked from commit bcc0f70)
(cherry picked from commit 0f2ed77)
* Apply patch for GMP CVE-2021-43618 * Update checksums (cherry picked from commit dea9805)
Otherwise, overrides do not trigger when using `artifact"..."` inside a submodule. (cherry picked from commit 9b106ad)
(cherry picked from commit 434d340)
(cherry picked from commit 3d6731b)
Set default blas num threads to Sys.CPU_THREADS / 2 in absence of OPENBLAS_NUM_THREADS Co-authored-by: SamuraiAku <[email protected]> (cherry picked from commit 390503e)
This fixes an issue where an error would be thrown in the REPL if you tried to transpose an input that was a single character while your cursor was to the right of that character (e.g., "A|"). To fix this, let's move left once before we check for if we're at the start of a line. This does change behavior slightly in that the cursor can move left once without actually transposing anything, but this seems to match what Emacs does with M-x transpose-chars in an equivalent situation. (cherry picked from commit 9dd993e)
There were some dependency updates that fixes security issues that should go in before RC. But should be in pretty good shape now. |
To check for regressions in this PR itself: @nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
8959a6e
to
5403c43
Compare
Co-authored-by: KristofferC <[email protected]> (cherry picked from commit 86f5501)
Distributed closes and destroys stdin, but some tests attempted to explicitly use it, leading to test problems. We previously interpreted this as passing devnull, but this is better to be explicit. (cherry picked from commit 64a86f9)
Co-authored-by: Dilum Aluthge <[email protected]>
a5753d0
to
2cf85b6
Compare
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
Backported PRs:
poll_while
#44280.op
in lowering #44770abstract_invoke
#44764===
when encountering null pointer #44749overlayed::Bool
property tononoverlayed::Bool
#44786ALWAYS_FALSE
withTRISTATE_UNKNOWN
#44808:total_may_throw
utility setting for@assume_effects
#44775Vararg
-arguments insubtype
rather than abort #44761PartialStruct
s #44966findsup
to return correctoverlayed
value #44804pinv
#45009iterate(::Dict)
#44534copyto!(dest, Rdest::CartesianIndices, src, Rsrc::CartesianIndices)
with different step. #45289config.sub
when building nghttp2 #45346expected assignment after const
error #45344Contains multiple commits, manual intervention needed:
Non-merged PRs with backport label:
invoke
d fallbacks #45001strides
forReshapedArray
with strided parent. #44507